package findMin2

func findMin(nums []int) int {
	l := len(nums)
	if l == 1 {
		return nums[0]
	}
	var tmp int = nums[0]
	for i := l - 1; i > 0; i-- {
		if tmp < nums[i] {
			return tmp
		}
		if tmp >= nums[i] {
			tmp = nums[i]
		}
	}
	return tmp
}
